package br.com.lopes.gci.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Permissao entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "permissao", catalog = "gcibd")
public class Permissao implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3223891031162348276L;
	// Fields
	@Id
	@Column(name = "codigo", unique = true, nullable = false)
	private Integer codigo;
	
	@Column(name = "url", length = 200)
	private String url;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "permissao")
	private List<PermissaoPerfil> permissaoPerfis = new ArrayList<PermissaoPerfil>(
			0);

	// Constructors

	/** default constructor */
	public Permissao() {
	}

	/** minimal constructor */
	public Permissao(Integer codigo) {
		this.codigo = codigo;
	}

	/** full constructor */
	public Permissao(Integer codigo, String url,
			List<PermissaoPerfil> permissaoPerfis) {
		this.codigo = codigo;
		this.url = url;
		this.permissaoPerfis = permissaoPerfis;
	}

	// Property accessors
	
	public Integer getCodigo() {
		return this.codigo;
	}

	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}

	
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	
	public List<PermissaoPerfil> getPermissaoPerfis() {
		return this.permissaoPerfis;
	}

	public void setPermissaoPerfis(List<PermissaoPerfil> permissaoPerfis) {
		this.permissaoPerfis = permissaoPerfis;
	}

}